<template>
	<view class="u-page__item">
		<u-tabbar
			:value="count"
			@change="switchTab"
			:fixed="true"
			:placeholder="true"
			:safeAreaInsetBottom="true"
		>
			<u-tabbar-item
				text="首页"
				icon="home"
			>
			</u-tabbar-item>
			<u-tabbar-item
			  text="人才管理库"
				icon="photo"
			></u-tabbar-item>
			<u-tabbar-item
				text="我的"
				icon="account"
			></u-tabbar-item>
		</u-tabbar>
	</view>
</template>

<script>

import util from "@/utils/utils.js"
import { countChat } from '@/api/index.js'
export default {
	props: {
		count: null
	},
	data() {
	    return {
				count:this.count,
				active:'/pages/enterprise/index',
				type:''
	    }
	  },
		mounted() {
			this.type = util.get('type')
			if(this.type == 1){
				this.active = '/resume/index'
				uni.reLaunch({
						url: this.active
				});
			}
		},
	  methods: {
	    switchTab(item) {
	      this.count = item;
				if(this.count == 0){
					this.active = '/pages/enterprise/index'
					uni.reLaunch({
							url: this.active
					});
				}
				else if(this.count == 1){
					this.active = '/pages/enterprise/resume'
					uni.navigateTo({
							url: this.active
					});
				}
				else if(this.count == 2){
					this.active = '/pages/enterprise/information'
					uni.navigateTo({
							url: this.active
					});
				}
				
			},
	  }
	}
</script>

<style lang="scss">
	.u-page {
		padding: 0;

		&__item {

			&__title {
				color: $u-tips-color;
				background-color: $u-bg-color;
				padding: 15px;
				font-size: 15px;

				&__slot-title {
					color: $u-primary;
					font-size: 14px;
				}
			}

			&__slot-icon {
				width: 17px;
				height: 17px;
			}
		}
	}
</style>

